<template>
    小李走人了
    <button @click="li">地址跳转传参数</button>
    <button @click="li1">跳转传参数</button>
</template>
<script setup>
import router from '@/router';

const li =()=>{
    router.push({path:'/home',query:{name:'li3'}})
}
const li1 =()=>{
    router.push({name:'home',state:{params:{name:'li4'}}})
    //后面是state到name之间是固定格式
}
</script>